package org.pmt.first.kms

import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberUpdatedState
import androidx.compose.ui.platform.LocalDensity
import io.github.aakira.napier.DebugAntilog
import io.github.aakira.napier.Napier
import org.jetbrains.compose.ui.tooling.preview.Preview
import org.koin.compose.KoinApplication
import org.pmt.first.kms.di.networkModule
import org.pmt.first.kms.screen.AppScreen

/**
 * todo list
 * 3. 新闻列表 + 图片加载
 * 4. 视屏播放
 * 5. 主题
 */

/**
 * todo learning
 * 1. MVI + Compose 原理
 * 2. koin 原理
 * 3. ktor 原理
 */

@Composable
@Preview
fun FairApp() {

    Napier.base(DebugAntilog())

    KoinApplication(application = {
        modules(networkModule)
    }) {


//    PreComposeApp {
        MaterialTheme {
//        var showContent by remember { mutableStateOf(false) }
//        Column(Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally) {
//            Button(onClick = { showContent = !showContent }) {
//                Text("Click me!")
//            }
//            AnimatedVisibility(showContent) {
//                val greeting = remember { Greeting().greet() }
//                Column(Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally) {
//                    Image(painterResource(Res.drawable.compose_multiplatform), null)
//                    Text("Compose: $greeting")
//                }
//            }
//        }

            AppScreen()
//            PreComposeSample()
//            PreComposeTest()
        }
//    }
    }
}
